package com.kaolafm.kradio.k_navi_map.location.present;

import android.util.Log;

import com.amap.api.navi.model.AMapNaviPath;
import com.amap.api.navi.model.NaviLatLng;
import com.kaolafm.kradio.k_navi_map.amap.AMapNaviManager;
import com.kaolafm.kradio.k_navi_map.base.IMapViewManager;
import com.kaolafm.kradio.k_navi_map.base.INaviManager;
import com.kaolafm.kradio.k_navi_map.basemvp.BasePresenter;
import com.kaolafm.kradio.k_navi_map.listener.OnNaviListener;
import com.kaolafm.kradio.k_navi_map.location.OnLocationListener;
import com.kaolafm.kradio.k_navi_map.location.base.ILocation;
import com.kaolafm.kradio.k_navi_map.location.factory.LocationFactory;
import com.kaolafm.kradio.k_navi_map.location.view.ILoctionMapView;

/**
 * Created by kaolafm on 2018/4/15.
 */

public class LocationMapPresent extends BasePresenter<ILocation, ILoctionMapView> {
    private ILocation mLocation;
    private INaviManager mNaviManager;

    public LocationMapPresent(ILoctionMapView view) {
        super(view);
        mLocation = LocationFactory.getInstance().initLocation(view.getActivityContext(), "amap");
        mNaviManager = new AMapNaviManager(view.getActivityContext());
    }

    public  void setMapViewManager(IMapViewManager mapViewManager){
        mNaviManager.setMapViewManager(mapViewManager);
    }

    public void startLocation(OnLocationListener onLocationListener){
        mLocation.startLocation(onLocationListener);
    }

    public void calculateSingleDriveRoute(NaviLatLng startLatLng, NaviLatLng endLatLng){
        mNaviManager.calculateSingleDriveRoute(startLatLng, endLatLng);
    }
}
